//
//  lxGoodsEntity.m
//  luodansc
//
//  Created by 倫 星 on 2012/11/28.
//  Copyright (c) 2012年 方正株式会社. All rights reserved.
//

#import "lxGoodsEntity.h"

@implementation lxGoodsEntity

@synthesize promote_price = _promote_price;
@synthesize goods_id = _goods_id;
@synthesize name = _name;
@synthesize brief = _brief;
@synthesize market_price = _market_price;
@synthesize short_name = _short_name;
@synthesize shop_price = _shop_price;
@synthesize thumb = _thumb;
@synthesize goods_img = _goods_img;
@synthesize comment_rank_img = _comment_rank_img;

- (id)init {
	self = [super init];
	if (self != nil) {
        _promote_price = 0.0f;
        _goods_id = 0;
        _name = nil;
        _brief = nil;
        _market_price = 0.0f;
        _short_name = nil;
        _shop_price = 0.0f;
        _thumb = nil;
        _goods_img = nil;
        _comment_rank_img = nil;
	}
	return self;
}

- (BOOL)setEntity:(NSDictionary *)dictionary {
    BOOL result = [super setEntity:dictionary];
    if (NO == result) {
        return NO;
    }
    
    _promote_price = [[dictionary objectForKey:@"promote_price"] floatValue];
    _goods_id = [[dictionary objectForKey:@"id"] intValue];
    _name = [lxStringUtility nil2String:[dictionary objectForKey:@"name"]];
    _brief = [lxStringUtility nil2String:[dictionary objectForKey:@"brief"]];
    _market_price = [[dictionary objectForKey:@"market_price"] floatValue];
    _short_name = [lxStringUtility nil2String:[dictionary objectForKey:@"short_name"]];
    _shop_price = [[dictionary objectForKey:@"shop_price"] floatValue];
    _thumb = [lxStringUtility nil2String:[dictionary objectForKey:@"thumb"]];
    _goods_img = [lxStringUtility nil2String:[dictionary objectForKey:@"goods_img"]];
    _comment_rank_img = [lxStringUtility nil2String:[dictionary objectForKey:@"comment_rank_img"]];
    
    return YES;
}

@end
